home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-20
/
bb21tu.zip
/
INTERNAL.DOC
< prev
next >
Wrap
Text File
|
1991-07-20
|
25KB
|
423 lines
This file contains documentation of file layouts. Its intended for for
programmers trying to write servers etc. If you are just going to run
the BBS, you can skip this!!!
When writing a server, try to keep to using IMPORT and EXPORT for
getting messages in and out of the BBS. This will allow you to contiue
to run even after I change the file formats.
General types used elsewhere
----------------------------
CONST
call_sign_len = 6;
bb_addr_len = 10;
h_addr_len = 32;
bid_len = 12;
password_len = 8;
file_name_len = 80;
subj_len = 128;
TYPE
bb_addr_str = STRING[bb_addr_len];
bb_full_addr = STRING[call_sign_len + 1 + h_addr_len];
bid_str = STRING[bid_len];
call_sign_str = STRING[call_sign_len];
file_name_str = STRING[file_name_len];
h_addr_str = STRING[h_addr_len];
password_str = STRING[password_len];
subj_str = STRING[subj_len];
MSG.BB
------
The file contains either one of two records per message. The second
record is needed to hold the distribution list. The first record is garbage
except for the record number. That number is the version number of the file.
It should be "2"
CONST
msg_dist_max = 20; (* Max number of distribution list *)
msg_path_max_msgs = 254; (* Max messages per path. Don't *)
(* exceed 254. *)
msg_path_max_route = 30; (* Max routes per path. Don't exceed*)
(* 254 *)
(*---------------------------------------------------------------------------*)
(* These define bits in msg_d_flag *)
(*---------------------------------------------------------------------------*)
CONST
df_fwd = $01; (* Message has been forwarded *)
df_fwd_select = $02; (* Message has been selected for forward *)
df_fwd_process = $04; (* Forward in process now *)
df_fwd_reject = $08; (* Bid was rejected *)
df_fwd_cancel = $10; (* Forward was cancelled by operator *)
df_fwd_unknown = $20; (* Unknown route *)
(*---------------------------------------------------------------------------*)
(* These define bits in msg_flag *)
(*---------------------------------------------------------------------------*)
CONST
mf_hold = $0001; (* Message is in hold *)
mf_read = $0002; (* Message has been read *)
mf_fwd = $0004; (* Message has been forwarded *)
mf_fwd_select = $0008; (* Message has been selected for fwd *)
mf_fwd_list = $0010; (* Distribution list attached *)
mf_old = $0020; (* Message is old *)
mf_kill = $0040; (* Message has been killed *)
mf_fwd_process = $0080; (* Forward in process now *)
mf_review = $0100; (* Message for review by SYSOP *)
mf_h_receive = $0200; (* Hierarchial route received *)
mf_archive = $2000; (* Msg has been archived *)
mf_disrout = $4000; (* Distribution routing block present *)
mf_unknown = $8000; (* Routed to ? *)
(*---------------------------------------------------------------------------*)
(* Types *)
(*---------------------------------------------------------------------------*)
TYPE
msg_flag_type = WORD;
(* ----- This is the individual distribution list entries ------------- *)
msg_dist_entry_type = RECORD
msg_d_flag : BYTE; (* Flags for this item *)
msg_d_info : bb_addr_str; (* Where to forward to *)
END;
msg_dist_block_type = RECORD
msg_d_no : BYTE; (* No of items *)
msg_d_array : ARRAY[1..msg_dist_max] OF msg_dist_entry_type;
END;
(* ----- This is the file format -------------------------------------- *)
msg_block = RECORD
msg_number : WORD; (* This msg number *)
msg_type : CHAR; (* Type of msg -- list is below *)
msg_flag : msg_flag_type; (* Flags *)
msg_size : LONGINT; (* Message size *)
msg_to : call_sign_str; (* To addressee *)
msg_to_at : bb_addr_str; (* To mailbox address *)
msg_to_h : h_addr_str; (* To hierarchial route *)
msg_from : call_sign_str; (* From *)
msg_from_at : bb_addr_str; (* From mailbox *)
msg_from_h : h_addr_str; (* From hierarchial route *)
msg_dt_in : LONGINT; (* Message's date time at here *)
msg_dt_orig : LONGINT; (* Message's date time at origin *)
msg_no_orig : WORD; (* Message number at origin *)
msg_tread : BYTE; (* Times read (except sysops) *)
msg_bid : bid_str; (* Message bid *)
msg_r_call : call_sign_str; (* Call sign of reject station *)
msg_reason : BYTE; (* Reason for hold/review *)
msg_subj : subj_str; (* Subject *)
END;
USER.BB
-------
The file contains one record per user. The first record is garbage
except for the first word. That number is the version number of the
file. It should be "2"
(*---------------------------------------------------------------------------*)
(* These define bits in user_flag *)
(*---------------------------------------------------------------------------*)
CONST
user_f_trans = $0001; (* User is transparent *)
user_f_bbs = $0002; (* User is a BBS *)
user_f_abbs = $0004; (* User is an advanced BBS *)
user_f_sysop = $0008; (* User can be a remote sysop *)
user_f_adrchg = $0010; (* User has updated his home BBS *)
user_f_exclude = $0020; (* User is excluded *)
user_f_delete = $0040; (* User record is empty *)
user_f_local = $0080; (* User is a local *)
user_f_emerg = $4000; (* User is allowed on during emergencies *)
user_f_pbbs = $8000; (* User is a personal BBS *)
TYPE
user_class_type =
(user_c_nu, (* New user *)
user_c_uu, (* Unregistered user *)
user_c_ou, (* Old user *)
user_c_eu, (* Expert user *)
user_c_bu, (* BBS user *)
user_c_rsu, (* Remote sysop user *)
user_c_lsu); (* Local sysop user *)
user_record_type = RECORD
user_i_ptr : user_index_ptr; (* Pointer to index *)
user_id : call_sign_str; (* Call sign of user *)
user_ssid : ssid_sign_str; (* SSID of user *)
user_name : STRING[20]; (* User's name *)
user_bbs : bb_addr_str; (* Mail address *)
user_zip : STRING[10]; (* Zip code *)
user_port : CHAR; (* User's port *)
user_class : user_class_type; (* User class *)
user_flag : WORD; (* User flags *)
user_fmt : BYTE; (* Format of "L" *)
max_pac : WORD; (* Maximum packet siz*)
user_last : LONGINT; (* Last time on *)
user_l_time : LONGINT; (* Last time "L" done*)
user_l_cnt : WORD; (* Number of logons *)
user_n_time : LONGINT; (* Last time "N" done*)
user_pw : password_str; (* Password *)
user_sysop_p: BYTE; (* SYSOP password # *)
user_lang : CHAR; (* User language *)
user_scr_len: BYTE; (* Length of user's *)
(* screen *)
user_scr_wid: BYTE; (* Width of user's *)
(* screen *)
user_access : access_block_type;(* User access lvl *)
padding : ARRAY[1..4] OF BYTE;
END;
BBOPT.BB
--------
This file contains the options information. The first record is the
main option block followed by the port blocks and then the file blocks.
Each record is 4096 bytes long. This file changes format a lot but
the file control blocks have been fairly constant.
--- First block ---
port_count : BYTE; (* Number of ports *)
fd_count : BYTE; (* Number of file directories *)
opt_type_bpt : BOOLEAN; (* Limit types to B, P, and T *)
opt_sysop_is_in : BOOLEAN; (* Sysop is accepting calls *)
opt_sysop_bell : BOOLEAN; (* Sysop bell is on *)
opt_bid_for_p : BOOLEAN; (* Gen BID for P messages *)
opt_bid_for_t : BOOLEAN; (* Gen BID for T messages *)
opt_bid_for_blank : BOOLEAN; (* Gen BID for _ messages *)
opt_blank_to_p : BOOLEAN; (* Translate "S" to "SP" *)
opt_blank_to_b : BOOLEAN; (* Translate "S" to "SB" *)
opt_hold_dupe_bid : BOOLEAN; (* Hold duplicate bids *)
opt_kill_bbs_error : BOOLEAN; (* Disconnect BBS on any error *)
opt_direct_display : BOOLEAN; (* Write direct to display *)
opt_direct_snow : BOOLEAN; (* Avoid snow on CGA *)
opt_rename_k : BOOLEAN; (* Rename killed *)
opt_error : BOOLEAN; (* Log minor errors *)
opt_mono_tcb_trace : BOOLEAN; (* Special monochrome TCB trace *)
opt_trace : BOOLEAN; (* Run trace *)
opt_mon_time_stamp : BOOLEAN; (* Time stamp monitor data *)
opt_bbs_see_p : BOOLEAN; (* Allow BBS to see "P" messages *)
opt_already_conn : BOOLEAN; (* Duplicate connect check *)
opt_time_status : BOOLEAN; (* Update status line on time tick *)
opt_own_in_bcst : BOOLEAN; (* Own call in BCST *)
opt_yapp_state : BOOLEAN; (* Show YAPP states *)
opt_show_binary : BOOLEAN; (* Show binary data during s/r *)
opt_suppress_pfx : BOOLEAN; (* Don't show prefix on LO screen *)
opt_show_mismatch : BOOLEAN; (* Show mismatch during forward scrpt*)
opt_auto_hlookup : BOOLEAN; (* Do HLOOKUP each forward cycle *)
opt_extend_timeout : BOOLEAN; (* Extend timeout on ports *)
opt_personal_bbs : BOOLEAN; (* Personal BBS *)
opt_no_alt_header : BOOLEAN; (* Alternate header *)
opt_send_sid_alwys : BOOLEAN; (* Always send SID *)
opt_fill_blank_bbs : BOOLEAN; (* If @ BBS is blank fill from user *)
opt_no_lang_prompt : BOOLEAN; (* Language prompt control in registr*)
opt_no_full_review : BOOLEAN; (* If on, bypass full screen review *)
opt_blank_to_bbs : BOOLEAN; (* If on, set the default to bbs = ''*)
opt_autoset_to_bbs : BOOLEAN; (* If on, set the default to bbs to *)
(* that user's home BBS if any *)
operate_mode : op_mode; (* Operation mode *)
max_task_no : BYTE; (* Maximum number of tasks *)
this_bb_sign : call_sign_str; (* Call sign of BBS *)
this_bb_bid : call_sign_str; (* Call sign of BBS for bid purposes *)
sysop_sign : call_sign_str; (* Call sign of SYSOP *)
this_bb_addr : bb_addr_str; (* Address of BBS *)
this_bb_h : h_addr_str; (* Hieararchical addess of this BBS *)
this_bb_name : STRING[15]; (* SYSOP name *)
this_bb_loc : STRING[25]; (* Location *)
user_file_name: file_name_str; (* USER control file *)
msg_file_name : file_name_str; (* MSG control file *)
msg_file_dir : file_name_str; (* Directory for the msg files *)
mess_fn : file_name_str; (* File name for messages *)
dos_mess_fn : file_name_str; (* File name for DOS messages *)
route_fn : file_name_str; (* File name for route table *)
path_fn : file_name_str; (* File name for path table *)
log_fn : file_name_str; (* File name for log *)
help_fn : file_name_str; (* File name for help *)
doserr_fn : file_name_str; (* File name for DOS error messages *)
mon_fn : file_name_str; (* File name for monitor log *)
wakeup_fn : file_name_str; (* File name for wakeup *)
hlook_fn : file_name_str; (* File name for hlookup *)
passwd_fn : file_name_str; (* File name for password file *)
action_fn : file_name_str; (* File name for action file *)
n_mon : WORD; (* Number of mon items to keep *)
bid_fn : file_name_str; (* File name for bid table *)
n_bid : WORD; (* Number of bid items to keep *)
n_j_list : BYTE; (* Number of items on j list *)
hold_dupe_hdr : BYTE; (* Number of dup headers to hold *)
trace_file_name : file_name_str; (* Trace output *)
z_time_bbs : LONGINT; (* Timezone correction -- BBS *)
z_time_fwd : LONGINT; (* Timezone correction -- FWD *)
nofwd_kill : STRING[26]; (* Dont kill on forward *)
bcst_interval : BYTE; (* Broadcast interval in minutes *)
disc_delay : BYTE; (* Disconnect delay *)
fwd_delay : BYTE; (* Forward delay *)
opt_types : STRING[27]; (* Allowed types *)
emer_types : STRING[27]; (* Emergency types *)
operator_color: BYTE; (* Color of operator stuff *)
status_color : BYTE; (* Color of staus line *)
window_percent: BYTE; (* Window split percentage *)
scroll_mon : WORD; (* Monitor scroll *)
scroll_opr : WORD; (* Operator scroll *)
scroll_conn : WORD; (* Connect scroll *)
editor_free : WORD; (* Editor free size *)
bell_length1 : BYTE; (* Tone length *)
bell_length2 : BYTE; (* Warble length *)
max_headers : BYTE; (* Maximum number of headers *)
max_messages : BYTE; (* Maximum number of messages in stor*)
newuser_l_time: BYTE; (* How many days to show a new user *)
wp_bb_sign : bb_full_addr; (* Call sign of WP system to send to *)
home_expires : LONGINT; (* When Home BBS expires *)
b_fwd_stop : LONGINT; (* Don't forward bulletins after *)
(* this time period *)
dflt_b_expire : LONGINT; (* Default bulletin expiration date *)
language_list : lang_str; (* List of allowed languages *)
parm_file_ver : BYTE; (* Version number of parm file *)
--- Port block ---
port_type_type = (port_dedhost1, (* DED host mode -- TNC1 *)
port_dedhost2, (* DED host mode -- TNC2 *)
port_dedhost87, (* DED host mode -- PK-87 *)
port_bpqhost, (* DED host mode -- BPQ switch *)
port_pcpa, (* DRSI PC*PA *)
port_aeapk232, (* AEA PK-232 mode *)
port_g8bpq, (* G8BPQ switch *)
port_pc1xx, (* Paccom PC-1xx *)
port_modem, (* Modem with AT command set *)
port_serial, (* Dumb serial port *)
port_unknown); (* Not set *)
port_block_type = RECORD
next_port : port_block_ptr; (* -> next block *)
main_port : port_block_ptr; (* -> main port *)
rel_port : port_block_ptr; (* -> related port *)
aux_thread : tcb_ptr; (* Monitor thread *)
com_number : BYTE; (* COMx number *)
port_char : CHAR; (* Character for port*)
port_name : STRING[20]; (* Name of port *)
port_type : port_type_type; (* Port type *)
port_host_only : BOOLEAN; (* Host mode only tnc*)
port_sub_port : BOOLEAN; (* Sub port (PC*PA) *)
port_monitor : BOOLEAN; (* Monitor this port?*)
port_r_sysop : BOOLEAN; (* Remote sysop ok *)
port_up_down : BOOLEAN; (* Upload/Download ok*)
port_bcst : BOOLEAN; (* Bcst on this port *)
port_pk232_data_ack : BOOLEAN; (* PK232 dat ack wait*)
port_no_out_fwd : BOOLEAN; (* No outgoing fwd *)
port_no_busy_fwd : BOOLEAN; (* No outgoing fwd *)
(* when busy *)
port_no_binary : BOOLEAN; (* No binary allowed *)
port_use_user_chan : BOOLEAN; (* User user channel *)
(* for forwarding *)
port_dflt_trans : BOOLEAN; (* Default transpart *)
port_operate_mode : op_mode; (* Operation mode *)
port_num : CHAR; (* PCPA port # *)
port_color : BYTE; (* Display color *)
port_sema : BYTE; (* Semaphore number *)
port_no_mail_bcst : BYTE; (* Bdcst with no mail*)
port_no_mail_cnt : BYTE; (* Count of no mail *)
port_allow : user_class_type; (* Allow this class *)
dflt_pac : WORD; (* Default packet siz*)
max_pac : WORD; (* Max packet size *)
data_rate : WORD; (* Data rate to use *)
time_out : WORD; (* Time out in second*)
fwd_min : WORD; (* Forward minute *)
sked_fwd : LONGINT; (* Next time to fwd *)
max_conn : BYTE; (* Num of connects *)
max_chan : BYTE; (* Max capacity TNC *)
port_pend : BYTE; (* Maximum port pend *)
dflt_scrl : BYTE; (* Default screen len*)
reject_act : BYTE; (* Reject action *)
dflt_lang : CHAR; (* Default language *)
dflt_access : access_block_type;(* Default access *)
first_load : file_name_str; (* File to load *)
dflt_order : STRING[3]; (* Default fwd order *)
connected : port_connect_ptr; (* List of connects *)
call_list : port_call_ptr; (* list of calls hrd *)
CASE BYTE OF
0 : (* All ports but modm*)
(call_set : STRING[9]; (* Set this call *)
bcst_path : STRING[45]); (* Bcst this path *)
1: (* Modem ports *)
(modem_optns : BYTE; (* Signify modem opt *)
answer_ring : BYTE; (* Answer on this rin*)
cr_timeout : BYTE; (* CR time out *)
cur_rate : WORD; (* Current data rate *)
modem_echo : BOOLEAN; (* Echo on modem *)
modem_e_now : BOOLEAN; (* Echo on modem NOW *)
modem_crlf : BOOLEAN; (* CR=CR/LF for modem*)
modem_dial : BOOLEAN; (* Modem dialing *)
modem_conn : BOOLEAN; (* Modem connect msg *)
modem_freez : BOOLEAN; (* Freeze modem speed*)
port_modem_dcd : BOOLEAN); (* DCD on modem *)
--- File block ---
TYPE
fsb_name_str = STRING[10];
fsb_ptr = ^file_subsys_block;
file_subsys_block = RECORD
next_fsb : fsb_ptr;
fsb_name : fsb_name_str;
fsb_alias : STRING[60];
fsb_desc : STRING[60];
fsb_path : file_name_str;
fsb_f_subdir_ok : BOOLEAN;
fsb_binary : BOOLEAN;
fsb_up : user_class_type;
fsb_down : user_class_type;
END;
----
This is the access control block as used by the user and port records
TYPE
access_block_type = RECORD
access_flags : BYTE;
END;
(*---------------------------------------------------------------------------*)
(* Access flags *)
(*---------------------------------------------------------------------------*)
CONST
access_f_sysop = $80; (* User authentication as remote sysop requird*)
access_f_bbs = $40; (* User authentication as BBS required *)
access_f_user = $20; (* User authentication required *)
access_f_user_send = $10; (* User authentication required for send *)
access_letter_group : str4
= 'RBAS'; (* Letters representing each flag in order *)